<template>
	<view>
		<text>我是子组件</text>
		<input type="text" v-model="msg">
		<button @click="sonEvent">传值</button>
		
		<grandson></grandson>
		
	</view>
</template>

<script>
	import {
		ref
	} from 'vue';
	export default {
		emits: ["myclick"],
		props: [],
		setup(props, {
			emit
		}) {

			const msg = ref("");
			const sonEvent = () => {
				emit("myclick", msg);
			}

			return {
				msg,
				sonEvent
			}
		}
	}
</script>

<style>

</style>
